package com.csy.admin.web;


import com.csy.admin.entity.ResourceTag;
import com.csy.admin.service.ResourceTagService;
import com.csy.admin.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  标签控制类
 * </p>
 *
 * @author csy
 * @since 2018-09-20
 */
@RestController
@RequestMapping("/resourceTag")
public class ResourceTagController {

    @Autowired
    private ResourceTagService resourceTagService;

    @RequestMapping(value = "/select",method = RequestMethod.GET)
    public Result select(){
        List<ResourceTag> tagList = resourceTagService.list(null);
        ResourceTag root = new ResourceTag();
        root.setTagId(0L);
        root.setTagName("未选择");
        root.setParentId(-1L);
        root.setOpen(true);
        tagList.add(root);
        return Result.ok().put("tagList",tagList);
    }
}

